package com.github.jspxnet.worktask.model.enums;

import com.github.jspxnet.enums.EnumType;

/**
 * Created by jspx.net
 * author: chenYuan
 * date: 2021/9/28 0:50
 * description: 这里是超时处理
 **/
public enum  TaskTipEnumType implements EnumType {
     //提醒方式
    THIRD(4, "third","第三方触发"),

    SMS(3, "sms","短信"),

    //所有
    MAIL(2, "mail","邮件"),

    //有人数 默认为1
    MESSAGE(1, "message","站点消息"),

    NONE(0, "none","不提醒");

    private final int value;
    private final String code;
    private final String name;

    TaskTipEnumType(int value,String code, String name) {
        this.value = value;
        this.code = code;
        this.name = name;
    }

    static public TaskTipEnumType find(int value) {
        for (TaskTipEnumType c : TaskTipEnumType.values()) {
            if (c.value == value) {
                return c;
            }
        }
        return TaskTipEnumType.NONE;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public String getCode() {
        return code;
    }
}
